﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DesignPattern.DecoratePattern
{
    class Person
    {
        protected string name;
        public Person()
        {

        }
        public Person (string name)
        {
            this.name = name;
        }

        public virtual void Show()
        {
            Console.WriteLine("装扮的{0}",name);
        }
    }

    class Finery:Person 
    {
        protected Person person;

        public void Decorate(Person person)
        {
            this.person = person;
        }

        public override void Show()
        {
            person.Show();
        }
    }

    class BigTrousers:Finery
    {
        public override void Show()
        {
            Console.WriteLine("大裤衩");
            base.Show();
        }
    }

    class TShirt:Finery
    {
        public override void Show()
        {
            Console.WriteLine("T恤衫");
            base.Show();
        }
    }
}
